home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / msdos / ufi101f.zip / UFI.DOC next >
Text File  |  1993-09-29  |  22KB  |  552 lines

  1.  
  2.                           SHAREWARE DISCLAIMER
  3.                           --------------------
  4.  
  5.    No warranty is expressed or implied in the use of this software.  The
  6.    user assumes all risk of its use, misuse, and abuse.  The author will
  7.    make every reasonable attempt to provide bug-free and safe software,
  8.    but is never under legal obligation to do so.  Any part of this
  9.    disclaimer that may be determined invalid in a court of law will not
  10.    adversely affect any other part, and the remaining terms will be intact.
  11.  
  12.    This program is shareware.  It is not free.  Lots of hard work and
  13.    broken pencils are behind this software.
  14.  
  15.    For a single user, registration is only $7.  This gets you free access
  16.    to future versions, or we can actually mail you a diskette for $5 each.
  17.  
  18.    For corporate users, a site license is available for $49.  There is no
  19.    single-user corporate license, but the site license covers any number of
  20.    computers belonging to one business entity in a single ZIP CODE
  21.    (first 5 digits).  Exceptions to this license require written permission
  22.    of the author.  As soon as they are available, paid licensees are
  23.    entitled to a printed copy of the documentation as well, which they are
  24.    then free to copy and distribute to any licensed user.
  25.  
  26.    Using this software or distributing it constitutes your full agreement
  27.    with all of the above terms.  You may later revoke this agreement by
  28.    destroying all copies of the software and documentation and terminating
  29.    the use of the software.  The agreement is not terminated until
  30.    elimination of possessed copies is complete and will in no way be
  31.    retroactive.
  32.  
  33.    Distribution of this program as a complete and unaltered program is
  34.    allowed without any cost to you.  PLEASE DO NOT TAMPER WITH UFI IN ANY
  35.    WAY.  THERE IS A BUILT-IN INTEGRITY CHECK THAT WILL FAIL IF YOU ALTER
  36.    THE PROGRAM.  You may charge a reasonable fee to cover cost of the actual
  37.    distribution, but you may not represent it in any way as a 'license fee'
  38.    or 'purchase' of this program, nor may you collect any such fee.  You
  39.    may charge for a product that includes UFI so long as the work is not
  40.    largely based on UFI or largely enhanced by UFI.  It may be included as
  41.    a facility or a part of a large collection of tools.
  42.  
  43.    This program is Copyright 1993 Andrologic CMN.  All rights reserved.
  44.  
  45.                               HOW TO ORDER
  46.                               ------------
  47.  
  48.    Simply send the appropriate fee along with return address and type
  49.    of license desired (mention product name and personal or site license)
  50.    to the address at the bottom of this file.
  51.  
  52.  
  53.                               THE PROGRAM
  54.                               -----------
  55.  
  56.   Now that we got all that nasty legal business out of the way....
  57.  
  58.   UFI, what is it?  Universal File Information - a program conceived to
  59.   replace a myriad of separate utilities.  UFI can do all of these things:
  60.  
  61.   Direct a copy program to update older versions of files
  62.   Search for versions of a file newer than the one you have
  63.   Search for a file/files based on size, attribute, name, location,
  64.     contents, or date
  65.   Generate statistical reports for networks
  66.   Do some kind of batch processing on a wide variety of files, with
  67.     no memory overhead (environment mode)
  68.   Just about anything else you can imagine involving file maintenance
  69.  
  70.   UFI does these things with the information you find:
  71.  
  72.      Format in one of many different predefined formats, including
  73.         "DOS dir" format
  74.  
  75.      Format to a custom format defined at run-time, using the
  76.         drive letter, path, file name, extension, date, size, and
  77.         attribute string free-form
  78.  
  79.      Include directory information with the filename, or separate it
  80.         out to appear only once
  81.  
  82.      Place output data on screen, in file, in environment, or call a
  83.         program and use it as part of the command tail, or make a
  84.         batch file
  85.  
  86.      Place execution trace information and error notes in a log file.
  87.  
  88.   UFI can take directions from the command-line or from the UFI_PARMS
  89.   environment string.
  90.  
  91.   Recommendation : print this out or redirect it to a file for use with a
  92.   viewer or editor.
  93.  
  94. Syntax: 
  95.    ufi <spec> [<spec2> ... ] <options>
  96.  
  97. Note that you may specify multiple wildcards, e.g. *.txt *.doc *.bat
  98.  
  99.                                FILESPECS
  100.                                ---------
  101.  
  102.   You may include as many filespecs as you wish, up to the limit of the
  103.   command line.  You may also give no filespec, which causes *.* to be
  104.   assumed.
  105.  
  106.  
  107.                               OPTIONS INFO
  108.                               ------------
  109.  
  110. A word about options in UFI:
  111.  
  112.   Switches in UFI are pretty flexible.  There may be variations in notation
  113.   within this DOC so I'll attempt to explain all the possible mangulations
  114.   up front.
  115.  
  116.   If you wish to order the command-line handling unit used for this program,
  117.   contact the author (see the bottom of this file).
  118.  
  119.   A switch is preceeded either with the - or the / character.  This is to
  120.   be friendly to the occasional unixhead that gets stranded in some
  121.   uncivilised hole where they only have peecees.  Switches take "parameters",
  122.   either numeric or string or in some cases both.
  123.  
  124.   When a switch takes a number, the number should immediately follow the
  125.   switch letter.  Example /T2, not /T 2.  Negative numbers are sometimes
  126.   used, in which case you just do the same thing: /Z-50000.  Numbers are
  127.   internally treated as 32 bit signed integers.
  128.  
  129.   Strings are separated from the switch by either a = or :.  Additionally,
  130.   you may surround a string in a "" pair, in which case the = or : is no
  131.   longer required, but still may be included.  Lastly, a closing quote at
  132.   the end of a command line may be omitted, and is assumed to be located
  133.   after the last non-blank character on the line.
  134.  
  135.   /P=D:, /P:D:, -P="D:", -P"D:", and -P"D:
  136.  
  137.   are all acceptable.
  138.  
  139.   What's more, you can combine options on one switch character up to the
  140.   point where you have a string parm.  For example,
  141.  
  142.   -s4k-3p=d:
  143.  
  144.   is equivalent to
  145.  
  146.   /s4 /k-3 /p="d:"
  147.  
  148.   Any text following the quotation marks of a string parm will be interpreted
  149.   as the next parameter, generally a non-switch parameter.
  150.  
  151.   For example, you could do this:
  152.  
  153.   -s4k-3p"d:"*.*
  154.  
  155.   This would be interpreted the same as
  156.  
  157.   /s4 /k-3 /p=d:  *.*
  158.  
  159.   OR, for DOS-lovers,
  160.  
  161.   *.* /s4 /k-3 /p=d:
  162.  
  163.   Switches can be made to be case sensitive or not also on an individual
  164.   basis, but for the moment UFI itself is not case sensitive.
  165.  
  166.                                 LITERALS
  167.                                 --------
  168.  
  169.   In most cases, literals in UFI are pretty straightforward.  A string
  170.   containing no spaces may simply represent itself.  For example, if
  171.   you want to use the p option with c:\tools, you can just add:
  172.  
  173.   -p=c:\tools
  174.  
  175.   The same is true of the search parm c.  You can just type -c=text.
  176.   Now, if the text you want to search for contains spaces, just type
  177.   -c="text with spaces".
  178.  
  179.   Ah, but you ask, what if the text I'm searching for contains double-
  180.   quotes.  Now you need to type this:  -c="text with ""double quotes"""
  181.   Each pair of double quotes inside a literal is replaced with one
  182.   double quote in your search argument.  The argument above becomes
  183.   text with "double quotes".
  184.  
  185.   Tildes are used in UFI for some of the substitution strings.  If you
  186.   want a real tilde to appear in the string, just insert two.  In fact,
  187.   for UFI it is a general rule that any special character is escaped
  188.   by two immediately adjacent occurrances of that character.  In the case
  189.   of ~f, you would put ~f~f to actually get ~f to appear in the output.
  190.  
  191.  
  192.                                 OPTIONS
  193.                                 -------
  194.  
  195.    /* - perform program integrity check.  This is a rudimentary self-test
  196.       that stands a reasonable chance of thwarting a virus attack.
  197.  
  198.       PLEASE NOTE THAT ANY SORT OF TAMPERING WITH THE EXE FILE WILL CAUSE
  199.       THIS TEST TO FAIL.  YES, EVEN THAT.
  200.  
  201.    /P:<path> - startup path
  202.  
  203.       Specify this switch to allow specification of a starting search
  204.       directory when UFI is used in the tree search modes 1 and 2.  The
  205.       default is the current drive and directory.
  206.  
  207.       Please note that there is a difference between /P=D: and /P=D:\.
  208.       (/P=D: is equivalent to /P=D:.\, not the root)
  209.  
  210.    /E:<varname> - place filename of match in environment
  211.  
  212.       Specify this option to put the (first | next | last) hit in a specified
  213.       environment variable.  The environment variable will be set based on
  214.       the setting of the /O option.  Default is for no environment variable
  215.       set.  If you specify /E without a string, the variable _UFI_ is used.
  216.  
  217.       Note: in cases where you are running a shell it is a good idea to preset
  218.       an environment variable to some long string in order to provide enough
  219.       space.  DOS normally provides very little spare room in a secondary 
  220.       command shell's environment
  221.  
  222.  
  223.    /R={str} - recursion display
  224.  
  225.       This option turns on display of the current search directory during a
  226.       tree search.  This is especially handy during a volume or multi-
  227.       volume search where the output goes to a file.
  228.  
  229.       Optionally you can specify a string to be dumped to standard out on
  230.       each directory containing hits, giving some sort of delimeter in the
  231.       file.  Each occurrance of "~" is replaced by the directory name.
  232.  
  233.    /On - output format
  234.  
  235.       This option switch controls the format of the result set. 
  236.       A numeric value following the O determines the set type:
  237.          0 - full pathname reported
  238.          1 - file name only reported   (default)
  239.          2 - directory only reported
  240.          3 - drive letter only reported
  241.          4 - date/time reported
  242.          5 - date reported
  243.          6 - size reported
  244.          7 - DOS "dir" format
  245.          8 - file name no extension reported
  246.          9 - extension no filename reported
  247.         10 - file name, no extension, but with directory
  248.         11 - file name, ext, directory, but no drive letter
  249.         12 - relative pathname
  250.  
  251.         OR, leave out the number and use the Custom option:
  252.  
  253.         /O="string"
  254.  
  255.         ~d   is replaced with the drive letter
  256.         ~p - pathname
  257.         ~f - file name
  258.         ~e - file extension
  259.         ~z - file size
  260.         ~c - file date (c is for calendar)
  261.         ~t - file time
  262.         ~a - file attribute string
  263.  
  264.       1 is the default setting.
  265.  
  266.    /Sn - stop on [n: 0 first, 1 next (must use same env var), 2 last match
  267.  
  268.        Tells UFI when to stop.  The S is followed by a numeric value:
  269.           0 - stop on first hit
  270.           1 - stop on "next" hit.  You must use the environment option
  271.               with this one, and you must use the same variable.  This is
  272.               actually a feature, not a restriction, as you can have
  273.               several iterations going on just by using different variables.
  274.           2 - stop on last match.  This is the default setting, and will
  275.               normally display all matches.
  276.  
  277.        Note that if you use the /S switch with /E, then your variable
  278.        will be erased from the environment after the last match.  UFI
  279.        will continue to display the entire directory, but -e will be
  280.        ignored if it is accompanied by /s1 and your environment variable
  281.        is blank.  Bottom line: if the environment variable is blank, then
  282.        /s1e has the same effect as /s2.  Always start a batch file loop
  283.        with /s0 to set the variable.
  284.  
  285.  
  286.    /Tn - tree search (0 no tree, 1 specified path, 2 entire drive, 3 all
  287.          drives, 4 floppies also)
  288.  
  289.          Tells UFI what kind of file list you are going to search:
  290.             0 - no tree search.  Current directory only.
  291.  
  292.             1 - specified path (in /P option, or current dir).  Searches
  293.                 given path and all directories below that level
  294.  
  295.             2 - entire drive.  Searches the entire drive of the given
  296.                 or current path.  For example, /P=C: *.BAK will report
  297.                 all .BAK files on drive C.  Even if you specify /P=C:\TEST
  298.                 or something, if you include /T2, the drive will be searched
  299.                 from the root.  This is handy when you don't want to mess
  300.                 with editing strings in a batch file.
  301.  
  302.                 Here's an example of how you might use this:
  303.  
  304.                 Say you want to be able to write a batch file that finds
  305.                 all .BAK files on the drive that the BATCH FILE is on.
  306.  
  307.                 Simple: here's the batch file:
  308.                 _______
  309.                 ufi *.bak /T2 /P=%0
  310.                 REM * all but the drive letter of %0 is ignored.  If %0
  311.                 REM * contains no drive letter, then the current drive is
  312.                 REM * used.
  313.  
  314.             3 - searches every locateable drive on the system, except
  315.                 floppies
  316.  
  317.             4 - like #3, but with floppies.
  318.  
  319.    /@n - debug level (n: 0 display all vars, 1 trace, 2 continue on nonfatal)
  320.  
  321.          This is not fully implemented in all versions.  Requires password.
  322.          Password is available with registration.
  323.  
  324.    /Ln=<filename> - set log file name
  325.  
  326.          ** UNDER CONSTRUCTION - SOME FUNCTIONS NOT AVAILABLE **
  327.  
  328.          Creates a log file.  The action code, n, sets the level
  329.          of detail:
  330.  
  331.             ERROR REPORTING (n below):
  332.             0 - ignore I/O errors, report syntax errors and halt
  333.                 (no log file)
  334.             1 - report to UFIERROR.LOG and continue on I/O errors
  335.                 (default if /L with no number)
  336.             2 - Halt immediately on any I/O error
  337.  
  338.             NON ERROR REPORTING
  339.             n + 0  - log only errors as above
  340.             n + 10 - log only actions (start, exec, errors, stop)
  341.             ( 10, 11, 12...)
  342.             n + 20 - log param information
  343.             n + 30 - log everything (statistics on hits, etc...)
  344.  
  345.          Example:  to report I/O errors and log only actions,
  346.             the action_code will be 11.
  347.  
  348.  
  349.    /H  - detailed help (best to print it out)
  350.  
  351.          You're looking at it.
  352.  
  353.  
  354.                              FILTER SECTION
  355.                              --------------
  356.  
  357.    These options are "filters".  They help you filter out unwanted files.
  358.  
  359.    /[C|c]=<string> - Contents (not [C]ase sensitive, [c]ase sensitive)
  360.  
  361.          This option allows you to filter based on file contents.
  362.          -c=str Behaves like grep str.  -C=str behaves like grep -i str.
  363.  
  364.    /Zn - size greater than n (less than |n| if n < 0)
  365.  
  366.        /Z4097  will display any file larger than 4096.
  367.        /Z-4097 will display files 4096 bytes or smaller.
  368.  
  369.    /Dn:<date val> - filter on date [n: 0 On, 1 on or before, 2 on or after,
  370.                     -1 before, -2 after]
  371.        date format is MM-DD-(YY)YY
  372.  
  373.        Ok, dates get messy.  But here it is:
  374.          -2  shows files with a date LATER than the one you specified.
  375.          -1  shows files with a date EARLIER than the one you specified.
  376.           0  shows files only on the exact date that you specified.
  377.           1  shows files with a date EARLIER or THE SAME as the one
  378.              you specified.
  379.           2  shows files with a date LATER or THE SAME as  the one
  380.              you specified.
  381.  
  382.    /A:<attrib filters> - filters are RHSVDAM.  To exclude a file with A, use
  383.       "a".  To include use "A".  Filter not present is a don't care.
  384.  
  385.        Certain to give you a headache.  Ok, the filter string works like this.
  386.        If the letter for an attribute is there, then the file must match that
  387.        attribute to be a hit.  An UPPERCASE letter represents that the
  388.        attribute must be ON.  Lowercase means OFF.  If the letter representing
  389.        an attribute is not there at all, it's what we engineers call a DON'T
  390.        CARE.  It doesn't matter what the attribute is, the file will be
  391.        displayed.
  392.  
  393.           R - read only
  394.           H - hidden
  395.           S - system
  396.           V - volume label  (wanna search for a volume label?  Use /A=V !)
  397.           D - directory     (this can be off and tree searches still work,)
  398.                             (but the dirs aren't displayed)
  399.           A - archive
  400.           M - share attribute on novell nets.
  401.  
  402.        Normally, a DOS directory would use "hsv" as its attrib string, since
  403.        hidden and system files are skipped and volume labels are not reported
  404.        as files.  Be careful not to do things like /A=VD, as nothing has both
  405.        a directory and a volume label on.
  406.  
  407.  
  408.    /Xn={str}  Execute a program or command based on a DOS shell.  The string
  409.       passed is run through UFI's "~" substitute filter.  Each occurrance
  410.       of "~" represents the file name at the current iteration.
  411.  
  412.       If n = 1, then the execution string is written to the console
  413.       before execution.
  414.  
  415.  
  416.                                 EXAMPLES
  417.                                 --------
  418.  
  419.     For a simple first example, let's do this:
  420.  
  421. > ufi *.* /o7t0a="hsvd"
  422.  
  423.     This should look very much like the "dir" command.
  424.     Actually, most of that command line is superfluous.  The -t0 and -a="hsvd"
  425.     are the defaults, so "ufi /o7" does the same thing.
  426.  
  427.  
  428.  
  429. > ufi *.* /o7t2r=~: > fil
  430.  
  431.     This will create a file called "fil" which lists every file on disk in
  432.     a dir-like format.  There is one line separating directories containing
  433.     the directory's full path followed by a colon.
  434.  
  435. > ufi *.*
  436.  
  437.     This would look pretty much like a unix ls command.  Only the files are
  438.     listed without any additional information.
  439.  
  440. > ufi *.bat *.txt /x="filter ~"
  441.  
  442.     This would call the program or batch file called "filter" for each
  443.     occurance of *.bat or *.txt in the current dir, passing the file name
  444.     as the first parameter.
  445.  
  446. > ufi *.exe /o8x=~
  447.  
  448.     Executes every program in the current directory.  This could get really
  449.     fun.
  450.  
  451. > ufi *.bak /o8x="ren ~.bak ~.bku"
  452.  
  453.     Same as ren *.bak *.bku.  Why use ufi?  Take a look:
  454.  
  455. > ufi *.txt /o8x="dos2unix ~.txt ~.unx"
  456.  
  457.     How about that?  Converts all *.txt files to unix format, in the file
  458.     *.unx.
  459.  
  460. > ufi program.exe /t3o0x="copy c:\prog\program.exe ~"
  461.  
  462.     Updates all copies of program.exe occurring on any currently visible
  463.     drive.  Careful, this is sensitive only to filename.  Files called
  464.     program.exe will be ruthlessly overwritten.  In doing something like
  465.     this, you would probably want to use a program that will prompt first.
  466.  
  467. > ufi *.exe *.com *.bat /A=S /D2=04-31-93 /t2o8x="edit c:\docdir\~.doc"
  468.  
  469.     Scans the entire drive for occurrances of the filespec that are SYSTEM
  470.     files and dates on or later than 4-31-93 and edits a file with a like
  471.     name but extension DOC in the c:\docdir directory.
  472.  
  473.     Some other hints:  UFI can call itself in an /x command.
  474.     How about this:
  475.  
  476. > ufi *.exe -p:c:\ -o1 -x="ufi ~ -p=d:\ -o1 >> fil"
  477.  
  478.     This will search for all EXE files on d: that match exactly in name
  479.     to those on c:., and place the output in "fil".
  480.  
  481.     UFI can also be a pretty powerful batch file pal.  For example:
  482.  
  483.     ---------------------------------------------------------------------
  484.     @echo off
  485.     rem  First let's find the first match to our criteria...
  486.     rem
  487.     ufi *.exe -e=DOCFILE -o8s0d2:01-01-92 > nul
  488.     rem
  489.     rem easier on the eyes would be --> ufi *.exe -e=DOCFILE -o8 -s0 -d2:01-01-92 > nul
  490.     rem
  491.     if errorlevel 1 goto end
  492.     :loop
  493.     rem the variable contains only the first part of the filename (-o8)
  494.     edit %DOCFILE%.DOC
  495.     rem
  496.     rem switch to "findnext" -s1
  497.     ufi *.exe -e=DOCFILE -o8s1d2:01-01-92 > nul
  498.     if errorlevel 1 goto end
  499.     goto loop
  500.     rem Could check for DOCFILE! == ! also
  501.     :end
  502.     ---------------------------------------------------------------------
  503.  
  504.     This batch file locates all the programs with a date later than 01-01-92
  505.     and invokes the editor on the .DOC file of the same name.  For example,
  506.     if the directory in question had 1.EXE, 2.EXE, and 3.EXE in it, but only
  507.     2.EXE and 3.EXE were 92 or later, then this batch file would call the
  508.     editor "edit" once for 2.DOC and once for 3.DOC.  You could call any
  509.     program or other batch file here.  Think of it as a "for" in which you
  510.     can choose bits of the filenames.
  511.  
  512.  
  513.                             VERSION HISTORY
  514.                             ---------------
  515.  
  516.    1.01c    Added "Contents" filter with reasonable speed.  Incorporates
  517.             performance improvements made in 1.01b related to multiple
  518.             wildcard searches.  Also incorporates smarter escaping
  519.             algorithms for literal strings.
  520.  
  521.             Added better online help as requested by Timo Salmi and others.
  522.  
  523.             Compiled with latest version of support units.  Can't say
  524.             that this does anything but increase reliability.
  525.  
  526.    1.01b,a  not released, improvements not tested.
  527.  
  528.    1.00     First official release.  Added Execute (X) functionality,
  529.             fixed environment problems.  UFI now uses the parent (calling)
  530.             program's environment so that ufi can recursively call itself
  531.             and not violate its own data.
  532.  
  533.    0.99     First working version.  7 of the 8 options are fully functional.
  534.             (X) still needs work.  /E can be buggy sometimes.
  535.  
  536.                              AUTHOR CONTACT
  537.                              --------------
  538.  
  539.    Patrick Taylor/Andrologic
  540.    Internet - exuptr@exu.ericsson.se (1993)
  541.    BBS - The Sounding Board (a Wildcat! BBS) 214-596-2915
  542.    3308 Lanarc
  543.    Plano, TX  75023
  544.  
  545.    In the event that the author is difficult to find at some point in the
  546.    future, suggested good places to look would include:
  547.  
  548.    * The Wildcat! support BBS
  549.    * comp.lang.pascal (UseNet)
  550.    * Look for The Sounding Board on a recent BBS list.
  551.  
  552.